package com.atguigu.gmall.product.schedule;

import com.atguigu.gmall.common.constant.SysRedisConst;
import com.atguigu.gmall.product.bloom.BloomOpsService;
import com.atguigu.gmall.product.bloom.SkuBloomDataQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class RebuildBloomTask {

    @Autowired
    private BloomOpsService bloomOpsService;

    @Autowired
    private SkuBloomDataQueryService skuBloomDataQueryService;
    @Scheduled(cron = "0 0 3 ? * 3")
    public void rebuild(){
        //System.out.println("xxxxxxx");
        bloomOpsService.rebuildBloom(SysRedisConst.BLOOM_SKUID,skuBloomDataQueryService);
    }
}
